package ace.module.captcha.sms.core.impl.dao.entity;

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ace.module.captcha.sms.api.model.dto.CaptchaSmsItemConfigDto;

/**
* 短信验证码配置.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = CaptchaSmsItemConfigDto.TABLE_DESC)
@Table(CaptchaSmsItemConfigDto.TABLE_NAME)
public class CaptchaSmsItemConfig implements Serializable, GenericPageContent<Long> {

  /**
   * {@link CaptchaSmsApplication#getId()}
   */
  @Id
  @Schema(title = CaptchaSmsItemConfigDto.ID_TITLE, description = CaptchaSmsItemConfigDto.ID_DESC)
  private Long id;

  @Size(max = 255)
  @Schema(title = CaptchaSmsItemConfigDto.NAME_TITLE, description = CaptchaSmsItemConfigDto.NAME_DESC)
  private String name;

  @Nullable
  @Size(max = 255)
  @Schema(title = CaptchaSmsItemConfigDto.REMARK_TITLE, description = CaptchaSmsItemConfigDto.REMARK_DESC)
  private String remark;

  @Schema(title = CaptchaSmsItemConfigDto.ENABLE_TITLE, description = CaptchaSmsItemConfigDto.ENABLE_DESC)
  private Boolean enable;

  @Schema(title = CaptchaSmsItemConfigDto.ENABLE_SYSTEM_CODE_TITLE, description = CaptchaSmsItemConfigDto.ENABLE_SYSTEM_CODE_DESC)
  private Boolean enableSystemCode;

  @Size(max = 255)
  @Schema(title = CaptchaSmsItemConfigDto.SYSTEM_CODE_TITLE, description = CaptchaSmsItemConfigDto.SYSTEM_CODE_DESC)
  private String systemCode;

  @Schema(title = CaptchaSmsItemConfigDto.ATTEMPT_COUNT_TITLE, description = CaptchaSmsItemConfigDto.ATTEMPT_COUNT_DESC)
  private Integer attemptCount;

  @Schema(title = CaptchaSmsItemConfigDto.EXPIRE_IN_SECONDS_TITLE, description = CaptchaSmsItemConfigDto.EXPIRE_IN_SECONDS_DESC)
  private Long expireInSeconds;

  @Schema(title = CaptchaSmsItemConfigDto.SEND_INTERVAL_IN_SECONDS_TITLE, description = CaptchaSmsItemConfigDto.SEND_INTERVAL_IN_SECONDS_DESC)
  private Long sendIntervalInSeconds;

  @Size(max = 255)
  @Schema(title = CaptchaSmsItemConfigDto.CODE_STRING_TITLE, description = CaptchaSmsItemConfigDto.CODE_STRING_DESC)
  private String codeString;

  @Schema(title = CaptchaSmsItemConfigDto.CODE_LENGTH_TITLE, description = CaptchaSmsItemConfigDto.CODE_LENGTH_DESC)
  private Integer codeLength;

  @LogicDelete
  @Schema(title = CaptchaSmsItemConfigDto.DELETE_FLAG_TITLE, description = CaptchaSmsItemConfigDto.DELETE_FLAG_DESC)
  private Long deleteFlag;

  @CreatedDate
  @Schema(title = CaptchaSmsItemConfigDto.CREATE_TIME_TITLE, description = CaptchaSmsItemConfigDto.CREATE_TIME_DESC)
  private Long createTime;

  @LastModifiedDate
  @Schema(title = CaptchaSmsItemConfigDto.UPDATE_TIME_TITLE, description = CaptchaSmsItemConfigDto.UPDATE_TIME_DESC)
  private Long updateTime;

  @Version
  @Schema(title = CaptchaSmsItemConfigDto.ROW_VERSION_TITLE, description = CaptchaSmsItemConfigDto.ROW_VERSION_DESC)
  private Long rowVersion;

}
